<{include file="top.html" }>

	<style>
	.firstRow{
		background-image:url(<{$preStaticUrl}>Wap/images/ticketBGLargePart1.png);
		background-size:100% 100%;
		background-repeat:no-repeat;
		height:15.6rem;
	}
	.secondRow{
		background-image:url(<{$preStaticUrl}>Wap/images/ticketBGLargePart3.png);
		background-size:100% 100%;
		background-repeat:no-repeat;
		padding:1rem 1rem 2rem;
	}
	td{
		vertical-align:top;	
		padding-bottom:1rem;
	}
	tr > td:first-child{
		white-space:nowrap;
		padding-right:1.5rem;
		color:#999;
	}
	</style>
	</head>
	<body>
    <div class="xy-panel">
      <div class="xy-panel-content" style="bottom:0;padding:1.5rem 1rem;">
        <div class="xy-row vDirectionRow">
        	<div class="firstRow vAlignCenterRow hAlignCenterRow">
            	<div class="hAlignCenterDiv">
                    <div class="fontSizeXXL boldText blackFont" style="margin-bottom:1.5rem"><{$cardTitle}></div>
                    <div style="margin-bottom:1.5rem">卡券号：<{$code}></div>
                    <!--第一种情况-->
                    <!--<div style="width:14rem; color:#e60012;">卡券已过期</div>-->
                    <!--第二种情况-->
                    <!--<div style="width:14rem; color:#e60012;">无核销权限</div>-->
                    <!--第三种情况-->
                    <{if $canConsume eq 0}>
                    <div class="CanMake" style="width:14rem;" id="reason"><{$reason}></div>
                    <{else}>
                    <div style="width:14rem; color:#e60012;"><{$reason}></div>
                    <{/if}>

            	</div>
            </div>
        	
            <div class="secondRow">
                <div class="xy-row vDirectionRow ticketDesContainer">
                	<div class="blackFont" style="margin-bottom:1.2rem; text-align:center; color:#999;">有效日期&nbsp;<span style="color:#333;"><{"Y.m.d"|date:$begin}></span>&nbsp;至&nbsp;<span style="color:#333;"><{"Y.m.d"|date:$end}></span></div>
                </div>
            </div>

            <{if $canConsume eq 0}>
                <div class="ui-button ui-button-2">
                    <button id="consume-btn">确认核销</button>
                </div>
            <{else}>
                <div class="ui-button ">
                    <button>无法核销</button>
                </div>
            <{/if}>

        </div>
      </div>

<script>
    $("#consume-btn").bind('click',function(){
        shopConsume();
    });


    function shopConsume(){
        var code="<{$code}>";
        $.getJSON("<{u('shopConsume_do')}>",{'code':code},function(result){
            layer.msg(result.msg);
            $('#reason').text(result.msg);
            $("#consume-btn").unbind('click');
        });
    }

</script>
 <{include file="signBody.html"}>
</body>
</html>